// hyb_yl/krecovery/pages/postoperative_report/postoperative_report.js
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    wx.getSystemInfo({
      success: (result) => {
        console.log(result)
      },
    })
    var that = this;
    var back_orser = options.back_orser;
    var j_id = options.j_id;
    that.setData({
      back_orser:back_orser,
      j_id:j_id,
      names:options.names,
      telphone:options.telphone,
      back_orser:options.back_orser,
      numcard:options.numcard,
      sex:options.sex,
      openid:options.openid,
      age:options.age,
      zid:options.zid,
    })
    that.getdetail();
  },
  // 获取术后康复详情
  getdetail:function(){
    var that = this;
    app.util.request({
      'url':"entry/wxapp/green.baogao_detail",
      data:{
        back_orser:that.data.back_orser,
        j_id:that.data.j_id
      },
      success:function(res){
        that.setData({
          info:res.data
        })
      }
    })
  },
  // 获取随访内容
  getContent:function(e){
    var that = this;
    app.util.request({
      'url':"entry/wxapp/green.get_suifang",
      data:{
        zid:that.data.zid,
        j_id:that.data.j_id
      },
      success:function(res){
        that.setData({
          list:res.data
        })
      }
    })
  },
  add_suifang:function(){
    var that = this;
    var back_orser = that.data.back_orser;
    var j_id = that.data.j_id;
    var names = that.data.names;
    var telphone = that.data.telphone;
    var back_orser = that.data.back_orser;
    var numcard = that.data.numcard;
    var sex = that.data.sex;
    var openid = that.data.openid;
    var age = that.data.age;
    var zid = that.data.zid;
    wx.navigateTo({
      url: '/hyb_yl/krecovery/pages/followUp/followUp?j_id='+j_id+'&names='+names+'&telphone='+telphone+'&back_orser='+back_orser+'&numcard='+numcard+'&sex='+sex+'&openid='+openid+'&age='+age+'&zid='+zid,
    })
  },
  // 图片放大
  preview:function(e){
    var url=e.currentTarget.dataset.url;
    wx.previewImage({
      current: url, // 当前显示图片的http链接
      urls: [url] // 需要预览的图片http链接列表
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    this.getContent();
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})